package com.trkj.vo;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class BackLogProcessVo implements Comparable<BackLogProcessVo>{
	/**
	 * 流程编号
	 */
	private String processId;
	/**
	 * 流程类别名称
	 */
	private String processName;
	/**
	 * 发起人
	 */
	private String launchPeople;
	/**
	 * 发起时间
	 */
	private String launchTime;
	/**
	 * 任务名称
	 */
	private String taskName;
	/**
	 * 开始时间
	 */
	private String startTime;
	/**
	 * 任务编号
	 */
	private String taskId;

	public String getProcessId() {
		return processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}

	public String getProcessName() {
		return processName;
	}

	public void setProcessName(String processName) {
		this.processName = processName;
	}

	public String getLaunchPeople() {
		return launchPeople;
	}

	public void setLaunchPeople(String launchPeople) {
		this.launchPeople = launchPeople;
	}

	public String getLaunchTime() {
		return launchTime;
	}

	public void setLaunchTime(String launchTime) {
		this.launchTime = launchTime;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	public BackLogProcessVo(String processId, String processName, String launchPeople, String launchTime,
			String taskName, String startTime, String taskId) {
		super();
		this.processId = processId;
		this.processName = processName;
		this.launchPeople = launchPeople;
		this.launchTime = launchTime;
		this.taskName = taskName;
		this.startTime = startTime;
		this.taskId = taskId;
	}

	public BackLogProcessVo() {
		super();
		// TODO Auto-generated constructor stub
	}

	@Override
	public String toString() {
		return "BackLogProcessVo [processId=" + processId + ", processName=" + processName + ", launchPeople="
				+ launchPeople + ", launchTime=" + launchTime + ", taskName=" + taskName + ", startTime=" + startTime
				+ ", taskId=" + taskId + "]";
	}

	@Override
	public int compareTo(BackLogProcessVo o) {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
		long one=0;
		long two=0;
		try {
			one = sf.parse(this.getLaunchTime()).getTime();
			two = sf.parse(o.getLaunchTime()).getTime();
			if (one==two) {
				one =Long.valueOf(this.getProcessId()) ;
				two =Long.valueOf(o.getProcessId()) ;
			}
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return (one < two ? 1 :(one == two ? 0 : -1));  
	}
}
